Getting Ready: The Facebook System

Understand the Facebook problem and learn the questions to further simplify this problem.

Problem definition#

Facebook is a social media platform for users to connect with people and engage with different types of media and content. Users can connect with other users by sending friend requests or using the direct messaging feature. Each user has a profile where they can create posts to share with their friends. Facebook also allows its users to create pages regarding a topic of interest and groups to form a community of similar people. Facebook generates a personalized feed for its users based on their friends, liked pages, groups, and the content they engage with to ensure the best experience.

The Facebook home page of a user
The Facebook home page of a user

Expectations from the interviewee#

Facebook provides multiple functionalities to its users. It is important to narrow down what components you will include in your Facebook design. The section below provides an overview of some of the main expectations that the interviewer will want to hear you discuss in more detail during the interview.

Discoverability#

It is important to develop a better understanding of how Facebook’s discoverability works. The interviewer would expect you to ask the questions listed below:

  • How are users able to search other users’ profiles?

  • Can users search other users using their phone numbers and email addresses?

Friends and following#

The “Add friend” feature of Facebook is its most renowned feature. Make sure to ask the interviewer the questions provided below:

  • How are users able to add other users as friends?

  • How are users able to follow or unfollow other users without becoming a direct connection?

Groups and pages#

Groups and pages on Facebook create a space for like-minded individuals. Make sure to define your requirements. You may ask the interviewer the questions listed below:

  • How are users able to create both groups and pages in addition to their user profiles?

  • What are the criteria for joining a group? Can a user join a group if they are not friends with the creator of the group?

Privacy#

You can ask the following questions to learn about the privacy feature in your design:

  • How will the system handle privacy lists with certain content to be displayed only to specified connections?

  • How do users set the privacy of groups? How does this change the way members and non-members interact with the group?

Alerts#

Notifications and alerts allow users to stay updated with the activity in their circle. Therefore, you may want to understand how alerts will work in your system. You may ask the questions listed below:

  • How will users be notified of pre-selected events?

  • How much control do users have in choosing what notifications they can receive?

Design approach#

We’ll design Facebook using the bottom-up design approach. For this purpose, we will follow the steps below:

  • Identify and design the smallest components first, like, a post and comment.

  • Use these small components to design bigger components, for example, pages, groups, and profiles.

  • Repeat the steps above until we design the complete Facebook platform.

Design pattern #

During an interview, it is always a good practice to discuss the design patterns that a parking lot system falls under. Stating the design patterns gives the interviewer a positive impression and shows that the interviewee is well-versed in the advanced concepts of object-oriented design.

Try to answer the following question. If you are not familiar with design patterns, don’t worry! You can learn about them by asking questions like, “Define design patterns.”

Which design pattern(s) should be used to design the Facebook system? Please elaborate on your choice(s).

Please enter the correct design pattern(s)



Let’s explore the requirements of Facebook in the next lesson.

Code for the Restaurant Management System

Requirements for Facebook